package com.fitbet.admin.service.principal;

import java.util.List;

import com.demo2do.core.entity.page.Page;
import com.demo2do.core.persistence.support.QueryFilter;
import com.fitbet.admin.entity.principal.Principal;
import com.fitbet.admin.entity.security.Login;
import com.fitbet.admin.service.DataService;

/**
 * @author xiaoHU
 *
 */
public interface PrincipalService extends DataService<Principal> {

    /**
     * @param login
     * @return
     */
    public int count(Login login);

    /**
     * 
     * @param name
     * @return
     */
    public Principal load(String name);

    /**
     * @param login
     * @param with
     * @return
     */
    public List<Principal> list(Login login, Page with);

    /**
     * @param principal
     */
    public void createPrincipal(Principal principal);

    /**
     * @param principal
     */
    public void freeze(Principal principal);

    /**
     * @param principal
     */
    public void activate(Principal principal);

    /**
     * @param principal
     */
    public void resetPassword(Principal principal);

    /**
     * @param principal
     * @param password
     */
    public void changePassword(Principal principal, String password);

    /**
     * @param id
     * @param principal
     */
    public void edit(Long id, Principal principal);

    /**
     * @param class1
     * @param preparedFilter
     * @return
     */
    public int countSearch(Class<Principal> class1, QueryFilter preparedFilter);

}
